package com.practice.car.cardataapp.controller;

import com.practice.car.cardataapp.util.R;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * car-data-app project
 *
 * @author ZhangMingXing
 * @date 2020/9/9
 */
@RestController
@RequestMapping("system")
public class SystemMessageController {

	@Getter
	@Setter
	@Value("${houduan_domain}")
	private String url;

	@GetMapping("spark")
	public R redirectSpark(HttpServletResponse response) throws Exception{
		// TODO: 2020/9/7 0007
		// TODO: 2020/9/8 0008
		return R.create().put("url","http://"+url+":8080");
	}

	@GetMapping("hadoop")
	public R redirectHadoop(HttpServletResponse response) throws Exception{
		// TODO: 2020/9/7 0007
		return R.create().put("url","http://"+url+":50070");
	}

	@GetMapping("mysql")
	public R redirectMysql(HttpServletResponse response) throws Exception{
		// TODO: 2020/9/7 0007
		return R.create().put("url","http://"+url+":9090/CarBigData/druid");
	}
}
